package com.example.dubbo.consumer;

import com.example.dubbo.common.bean.User;
import com.example.dubbo.common.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DubboConsumer {

    @SuppressWarnings("resource")
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("dubbo-consumer.xml");
        UserService userService = applicationContext.getBean(UserService.class);

        System.out.println("dubboClient.get ---> " + userService.get(1));
        User user = new User(null, "dubbo", 18);
        System.out.println("dubboClient.add ---> " + userService.add(user));
    }

}
